package com.erp.auto.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.erp.auto.domain.ErpAutoUnshelfProductLog;
import com.erp.auto.mapper.ErpAutoUnshelfProductLogMapper;
import com.erp.auto.service.ErpAutoUnshelfProductLogService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 自动化下架商品表
 *
 * @author WXX
 * @date 2024-01-29 14:04:36
 */
@Service
@AllArgsConstructor
public class ErpAutoUnshelfProductLogServiceImpl extends ServiceImpl<ErpAutoUnshelfProductLogMapper, ErpAutoUnshelfProductLog> implements ErpAutoUnshelfProductLogService {

    private final ErpAutoUnshelfProductLogMapper erpAutoUnshelfProductLogMapper;

    @Override
    public List<ErpAutoUnshelfProductLog> selectList(ErpAutoUnshelfProductLog log) {
        LambdaQueryWrapper<ErpAutoUnshelfProductLog> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(log.getConfigId() != null, ErpAutoUnshelfProductLog::getConfigId,log.getConfigId());
        queryWrapper.eq(log.getStatus() != null, ErpAutoUnshelfProductLog::getStatus, log.getStatus());
        queryWrapper.ge(log.getCreateTime() != null, ErpAutoUnshelfProductLog::getCreateTime, log.getCreateTime());
        queryWrapper.le(log.getUpdateTime() != null, ErpAutoUnshelfProductLog::getCreateTime, log.getUpdateTime());
        return erpAutoUnshelfProductLogMapper.selectList(queryWrapper);
    }
}
